var EditBlogTypePage = {
	// 删除博客类型成功回调
	'onDeleteBlogTypeSucc':function(data, status, xhr) {
		MsgBox.info(data.message, null, function() {
			EditBlogTypePage.valueChanged = false;
			findBlogCategoryAjax.send();
		});
	},
	// 查询所有博客类型成功回调
	'findCategorySucc':function(data, status, xhr) {
		EditBlogTypePage.blogTypeAside = $("#blogCategoryList").aside({
			'defaultId':EditBlogTypePage.lastId,
			'data':data.info,
			'contentDefine':{
				'key':'codeInfoValue',
				'value':'codeInfoName'
			},
			'delete':true,
			'onDelete':function(key, value) {
				deleteBlogCategoryAjax.addParam('codeInfoValue', key);
				deleteBlogCategoryAjax.send();
			},
			'onItemClick':function(item, $dom) {
				if (EditBlogTypePage.valueChanged) {
					// 当值发生改变时，切换分类要保存先前的值
					if ($("#editCodeInfoFrm").formValidate()) {
						$.messager.info("正在保存博客分类...");
						editCodeInfoAjax.send();
					}
					return true;
				}
				$("#editCodeInfoFrm").autofill(item);
			}
		});
	},
	// 保存博客分类按钮
	'saveBlogType':function() {
		if ($("#editCodeInfoFrm").formValidate()) {
			editCodeInfoAjax.send();
		}
	},
	// 记录博客类型表单里的值的变化，一旦发生变化，valueChanged = true
	'valueChanged':false,
	'onValueChanged':function() {
		EditBlogTypePage.valueChanged = true;
	},
	// 上次点击的位置
	'lastId':null,
	'onEditBlogTypeSucc':function(data, status, xhr) {
		$.messager.info("保存成功！");
		EditBlogTypePage.valueChanged = false;
		findBlogCategoryAjax.send();
	},
	// 博客名称发生变化
	'onBlogTypeNameChanged':function(ele) {
		var blogTypeName = $(ele).val();
		if (StringUtil.isBlank(blogTypeName)) {
			MsgBox.info("博客名称不能为空！", null, function() {
				$("#editCodeInfoFrm").find("input[name='codeInfoName']").focus();
			});
			return ;
		}
		EditBlogTypePage.blogTypeAside.updateCurrentText(blogTypeName);
	},
	// 关闭对话框
	'closeDialog':function() {
		var mWindow = MsgBox.getCurrentOpenDialogWindow();
		mWindow.findBlogCategoryAjax.send();
	},
	'blogTypeAside':null,
	// 新增博客类型
	'addBlogType':function() {
		EditBlogTypePage.blogTypeAside.addNode({
			'codeInfoName':'--',
			'codeType.codeTypeId':'blogType',
			'state':'1'
		});
	}
};